/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.applicatioN.entities;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Slim
 */
@Entity
@Table(name = "exiger_4")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Exiger4.findAll", query = "SELECT e FROM Exiger4 e"),
    @NamedQuery(name = "Exiger4.findByMention", query = "SELECT e FROM Exiger4 e WHERE e.mention = :mention"),
    @NamedQuery(name = "Exiger4.findByPoste", query = "SELECT e FROM Exiger4 e WHERE e.poste = :poste"),
    @NamedQuery(name = "Exiger4.findBySpecialite", query = "SELECT e FROM Exiger4 e WHERE e.exiger4PK.specialite = :specialite"),
    @NamedQuery(name = "Exiger4.findByNomPoste", query = "SELECT e FROM Exiger4 e WHERE e.exiger4PK.nomPoste = :nomPoste")})
public class Exiger4 implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected Exiger4PK exiger4PK;
    @Column(name = "MENTION")
    private String mention;
    @JoinColumn(name = "SPECIALITE", referencedColumnName = "SPECIALITE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Specialite specialite1;
    @JoinColumn(name = "NOM_POSTE", referencedColumnName = "NOM_POSTE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Poste poste;

    public Exiger4() {
    }

    public Exiger4(Exiger4PK exiger4PK) {
        this.exiger4PK = exiger4PK;
    }

    public Exiger4(String specialite, String nomPoste) {
        this.exiger4PK = new Exiger4PK(specialite, nomPoste);
    }

    public Exiger4PK getExiger4PK() {
        return exiger4PK;
    }

    public void setExiger4PK(Exiger4PK exiger4PK) {
        this.exiger4PK = exiger4PK;
    }

    public String getMention() {
        return mention;
    }

    public void setMention(String mention) {
        this.mention = mention;
    }

    public Specialite getSpecialite1() {
        return specialite1;
    }

    public void setSpecialite1(Specialite specialite1) {
        this.specialite1 = specialite1;
    }

    public Poste getPoste() {
        return poste;
    }

    public void setPoste(Poste poste) {
        this.poste = poste;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (exiger4PK != null ? exiger4PK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Exiger4)) {
            return false;
        }
        Exiger4 other = (Exiger4) object;
        if ((this.exiger4PK == null && other.exiger4PK != null) || (this.exiger4PK != null && !this.exiger4PK.equals(other.exiger4PK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.applicatioN.entities.Exiger4[ exiger4PK=" + exiger4PK + " ]";
    }
}
